<%@ page language="java" pageEncoding="UTF-8" %>
<%@taglib prefix="s" uri="/struts-tags" %>
<%@include file="../../common/common-css.jsp" %>
<%@include file="../../common/common-js.jsp" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 <base href="<%String s = request.getRequestURL().toString(); out.print(s.substring(0, s.indexOf("/", 8)) + request.getContextPath()+"/");%>"/>
<title>为梦游戏-CPS查询系统</title>

<script>
var  highlightcolor='#eafcd5';
var  clickcolor='#51b2f6';
function  changeto(){
source=event.srcElement;
if  (source.tagName=="TR"||source.tagName=="TABLE")
return;
while(source.tagName!="TD")
source=source.parentElement;
source=source.parentElement;
cs  =  source.children;
if  (cs[1].style.backgroundColor!=highlightcolor&&source.id!="nc"&&cs[1].style.backgroundColor!=clickcolor)
for(i=0;i<cs.length;i++){
	cs[i].style.backgroundColor=highlightcolor;
}
}

function  changeback(){
if  (event.fromElement.contains(event.toElement)||source.contains(event.toElement)||source.id=="nc")
return
if  (event.toElement!=source&&cs[1].style.backgroundColor!=clickcolor)
for(i=0;i<cs.length;i++){
	cs[i].style.backgroundColor="";
}
}

function  clickto(){
source=event.srcElement;
if  (source.tagName=="TR"||source.tagName=="TABLE")
return;
while(source.tagName!="TD")
source=source.parentElement;
source=source.parentElement;
cs  =  source.children;
if  (cs[1].style.backgroundColor!=clickcolor&&source.id!="nc")
for(i=0;i<cs.length;i++){
	cs[i].style.backgroundColor=clickcolor;
}
else
for(i=0;i<cs.length;i++){
	cs[i].style.backgroundColor="";
}
}

</script>
</head>

<body>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="30">
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="15" height="30"><img src="${pageContext.servletContext.contextPath}/images/tab_03.gif" width="15" height="30" /></td>
        <td width="1101" background="${pageContext.servletContext.contextPath}/images/tab_05.gif">
         <form name="fenye" id="fenye" method="post" action="${pageContext.servletContext.contextPath}/user/getUserList" class="STYLE4">
			<div id="current">&nbsp;&nbsp;&nbsp;&nbsp;昵称：
			<input id="name" name="name"  type="text"/>
		 <input type="submit" value="查找"/> 
		  <img src="${pageContext.servletContext.contextPath}/images/add.gif"  style="padding-left:790px"/>
	      <a href="${pageContext.servletContext.contextPath}/role/addRole">新增</a>
		 </div>
	      </form>
	      </td>
	     
        <td width="14"><img src="images/tab_07.gif" width="14" height="30" /></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="9" background="${pageContext.servletContext.contextPath}/images/tab_12.gif">&nbsp;</td>
        <td bgcolor="#f3ffe3">
         <table bgcolor="#f3ffe3" border="1" onmouseover="changeto()"  onmouseout="changeback()">
          <tr>
            <td width="5%" height="26" background="${pageContext.servletContext.contextPath}/images/tab_14.gif" ><div align="center" class="STYLE2 STYLE1">角色昵称</div></td>
            <td width="2%" height="18" background="${pageContext.servletContext.contextPath}/images/tab_14.gif" class="STYLE1"><div align="center" class="STYLE2 STYLE1">角色状态</div></td>
            <td width="3%" height="18" background="${pageContext.servletContext.contextPath}/images/tab_14.gif" class="STYLE1"><div align="center" class="STYLE2 STYLE1">基本操作</div></td>
          </tr>
          
          <c:forEach items="${result.results}" var="role">
          <tr>
            <td height="10" bgcolor="#FFFFFF" class="STYLE2"><div align="center" class="STYLE2 STYLE1">${role.roleName}</div></td>
            <td height="10" bgcolor="#FFFFFF"><div align="center" class="STYLE2 STYLE1"><c:if test="${role.status eq '0'}">禁用</c:if><c:if test="${role.status eq '1'}">启用</c:if></div></td>
         <td height="20" bgcolor="#FFFFFF">
        <div align="center">
        <img src="${pageContext.servletContext.contextPath}/images/sel.gif" width="16" height="16"/>
        <a href="${pageContext.servletContext.contextPath}/role/getResourcesList?id=${role.id}">权限分配</a>
        <img src="${pageContext.servletContext.contextPath}/images/upd.gif" width="16" height="16"/>
        <a href="${pageContext.servletContext.contextPath}/role/findRoleById?id=${role.id}">修改</a>
        <img src="${pageContext.servletContext.contextPath}/images/del.gif" width="16" height="16"/>
        <a href="${pageContext.servletContext.contextPath}/role/deleteRole?id=${role.id}">删除</a>
        </div>
        </td>
          </tr>
 	</c:forEach>
        </table></td>
        
        <td width="9" background="${pageContext.servletContext.contextPath}/images/tab_16.gif">&nbsp;</td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td height="29"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <table width="100%" hight="20px" border="0" cellspacing="0" cellpadding="0">
          <tr>
         <td background="${pageContext.servletContext.contextPath}/images/tab_14.gif">
           <%@include file="../../common/webfenye.jsp" %>
         </td>     
              </tr>  
              </table>   
                </td>
          </tr>
        </table></td>
         
      </tr>
    </table></td>
  </tr>
</table>
</body>
</html>
